﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace OmixJsonServer.Helpers
{
    public static class DbHelper
    {
        private static Omix.Dynamic.Data.Database _db;
        private static string _connectionString;

        public static Omix.Dynamic.Data.Database DB
        {
            get
            {
                return _db;
            }
        }

        static DbHelper()
        {
            Init();
        }

        public static void Init()
        {
            _connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;
            _db = new Omix.Dynamic.Data.Database(_connectionString);
            _db.Load();
        }
    }
}